// File Name: key_task.c
// Author: kukukukuku~
// Date: 2024-12-24

#include "./Key/inc/key_task.h"

//Key任务句柄
TaskHandle_t keyTaskHandle;


/**
 * @brief   Key任务
 * @param   arg:    任务参数
 * @retval  None
 * @note    None
*/
void key_task(void *arg)
{
    key_object_init(&keyClearObj, &keyClearGpioObj, KEY_CLEAR_LONG_PRESS_NUM_1MS, KEY_CLEAR_PRESS_POLARITY);
    
    while(1)
    {
        //按键扫描
        key_scan(&keyClearObj);
        
        //不需要长按判断，关闭定时器
        if(key_long_press_scan_flag_get(&keyClearObj) == 0)
            key_tmr1_disable();
        
        vTaskDelay(10);
    }
}
